/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package persistence;

import java.io.Serializable;
import persistence.dao.FilesystemDao;
import persistence.dao.ProjectDao;
import persistence.dao.ScheduleBaselineDao;
import persistence.interfaces.IFilesystemDao;
import persistence.interfaces.IProjectDao;
import persistence.interfaces.IScheduleBaselineDao;

/**
 *
 * @author gurgel
 */
public class PersistFactory implements Serializable {

    private static IProjectDao projectDao;
    private static IFilesystemDao filesystemDao;
    private static IScheduleBaselineDao scheduleBaselineDao;

    public synchronized static IFilesystemDao getFilesystemDao() {
        if (filesystemDao == null) {
            filesystemDao = new FilesystemDao();
        }
        return filesystemDao;
    }

    public synchronized static IProjectDao getProjectDao() {
        if (projectDao == null) {
            projectDao = new ProjectDao();
        }
        return projectDao;
    }

    public synchronized static IScheduleBaselineDao getScheduleBaselineDao() {
        if (scheduleBaselineDao == null) {
            scheduleBaselineDao = new ScheduleBaselineDao();
        }
        return scheduleBaselineDao;
    }
}
